package com.sky.controller.user;

import com.sky.constant.StatusConstant;
import com.sky.entity.Dish;
import com.sky.entity.User;
import com.sky.result.Result;
import com.sky.service.DishService;
import com.sky.vo.DishVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController("userDishController")
@RequestMapping("/user/dish")
@Slf4j
@Api(tags = "客户端菜品浏览接口")
public class DishController {
    @Autowired
    private DishService dishService;

    @GetMapping("/list")
    @ApiOperation("分类id菜品查询")
    public Result<List<DishVO>> selectlist(Long categoryId){
        /*Dish dish = new Dish();
        dish.setCategoryId(categoryId);
        //查询起售中的套餐
        dish.setStatus(StatusConstant.ENABLE);*/
        List<DishVO> list=dishService.selectlist(categoryId);
        return Result.success(list);
    }
}
